﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GameSchool.Extra;
using System.ComponentModel.DataAnnotations;

namespace GameSchool.Models
{
	/// <summary>
	/// LevelParticipate er gagnaklasi sem heldur utan um hvort nemandi hafi 
	/// tekið þátt í borði innan námskeiðs og skráir þátttökuna í gagnagrunninn. 
	/// </summary>
	
	[Table ("gs_level_participate")]
	public class LevelParticipate
    {
        [Key]
		[Column("level_participate_id")]
		public int LevelParticipateId { get; set; }

        [Column("student_id")]
        public int StudentId { get; set; }

        [ForeignKey("StudentId")]
        public virtual Person Student { get; set; }

        [Column("level_id")]
        public int LevelId { get; set; }

        [ForeignKey("LevelId")]
        public virtual Level Level { get; set; }

		[Column("open_date")]
        public DateTime OpenDate { get; set; }

        [Column("state_type")]
        public Int16 StateTypeValue { get; set; }

        [NotMapped]
        public CustomTypes.LevelParticipateStateType StateType 
        { 
            get
            {
                return (CustomTypes.LevelParticipateStateType) this.StateTypeValue;
            }
            set
            {
                this.StateTypeValue = (Int16) value;
            }
        }
    }
}